fid = fopen('round_nearest_even.out', 'w');

m = 8; n = 5; r = 6; k = 2;

step_b = 2^(-n);

for b = 0:step_b:0.999
    disp_bin(b, 0, n, fid); fprintf(fid,'|');
    b_rne = rnd_rne(b, 2);
    if(b_rne < 1.0)
        disp_bin(b_rne, 0, 2, fid);
    else
        disp_bin(0.0, 0, 2, fid);
    end
    fprintf(fid,'\n');
end